<template>
  <div class="main">
    <h1>type:{{ type }}</h1>
    <div class="main-default">
      <!-- 可写默认值当index.vue中默认插槽没值展示 -->
      <slot :num3="num3">可写默认值</slot>
    </div>
    <slot name="name1" :num1="num1"></slot>
    <slot name="name2" :num2="num2"></slot>
  </div>
</template>

<script>
export default {
  name: 'slot-main',
  data() {
    return {
      num1: 1,
      num2: 2,
      num3: 3
    }
  },
  props: {
    type: {
      type: String,
      default: ''
    }
  }
}
</script>

<style lang="scss" scoped>
.main {
  min-height: calc(100vh - 200px);
  width: 1200px;
  margin: 0 auto;
  background-color: #ccc;
}
</style>
